<?php

namespace app\index\service;

use app\common\model\Member;
use app\index\dao\MemberDao;
use app\index\model\UM as UM;

/**
 * Class TokenAccountService
 * @package app\index\service
 */
class TokenAccountService
{
    // dao
    private MemberDao $memberDao;

    public function __construct(MemberDao $memberDao)
    {
        $this->memberDao = $memberDao;
    }


    /**
     * 查询我的代币账户
     * @param UM|null $user
     * @return array
     */
    public function read(UM $user): array
    {
        $account = $user->account;
        $card = $user->card;
        $coin = $user->coin;

        return [
            'account' => $account,
            'card' => $card,
            'coin' => $coin,
        ];
    }

}
